<template>
  <zm-view ref="view">
    <view class="p-24">
      <zm-richtext :content="agreement[type]"></zm-richtext>
    </view>
  </zm-view>
</template>

<script>
import page from "@/mixins/page"
import hook from "@/mixins/hook"
export default {
  mixins: [page, hook],
  data() {
    return {
      type: "userAt",
      agreement: {}
    }
  },
  computed: {},
  onLoad(options) {
    this.type = options.type
    this.title = options.title
    this.handleGetAgreement()

    if (this.title) {
      uni.setNavigationBarTitle({ title: this.title })
    }
  },
  methods: {
    async handleGetAgreement() {
      this.agreement = await uni.$api.channel.getAgreement({ agreementList: "userAt,userPyAt" })
    }
  }
}
</script>

<style lang="scss" scoped></style>
